package com.apes.scm.masterdata.product.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @description: 折旧方法
 * @author: PengZiFeng
 * @create: 2021-08-13 16:41
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = FaDepreciationMethod.CONST_TABLE_NAME)
public class FaDepreciationMethod extends Model {

    public static final String CONST_TABLE_NAME = "fa_depreciation_method";

    @Id
    @Column(name = "id", nullable = false, length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "折旧方法", padding = 8)
    @Comment("类别编码")
    private String id;

    @Column(name = "name")
    @Comment("折旧方法名称")
    private String name;

    @Column(name = "amountexpression")
    @Comment("月折旧额表达式")
    private String amountexpression;

    @Column(name = "amountformula")
    @Comment("月折旧额公式")
    private String amountformula;

    @Column(name = "enablestate")
    @Comment("启动状态")
    private boolean enablestate;

}